package com.briup.cms.dao;

import com.briup.cms.bean.RolePrivilege;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface RolePrivilegeMapper {
    @Results(id = "RolePrivilegeMapper", value = {
            @Result(property = "roleId", column = "role_id"),
            @Result(property = "privilegeId", column = "privilege_id")
    })

    @Select("select * from cms_role_privilege")
    List<RolePrivilege> selectAll();

    @Insert("insert into cms_role_privilege values(null,#{roleId},#{privilegeId})")
    void insert(RolePrivilege role_privilege);
    @Update("update cms_role_privilege set role_id=#{roleId},privilege_id=#{privilegeId} where id=#{id}")
    void update(RolePrivilege role_privilege);
    @Delete("delete from cms_role_privilege where id=#{id}")
    void deleteById(long id);
}